package edu.szu.huhanpeng.doodlingFight.controller.dataController.gameStart 
{
	import edu.szu.huhanpeng.doodlingFight.globalConst.GlobalConst;
	import edu.szu.huhanpeng.doodlingFight.interfaces.IChessBoardData;
	import edu.szu.huhanpeng.doodlingFight.model.ChessBoardProxy;
	import edu.szu.huhanpeng.doodlingFight.model.data.ChessBoardData;
	import edu.szu.huhanpeng.doodlingFight.model.GameProxy;
	import edu.szu.huhanpeng.doodlingFight.view.ChessBoardMed;
	import edu.szu.huhanpeng.doodlingFight.view.GameWindowMed;
	import flash.display.DisplayObject;
	import org.puremvc.as3.interfaces.ICommand;
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.interfaces.INotifier;
	import org.puremvc.as3.patterns.command.SimpleCommand;
	
	/**
	 * ...
	 * @author Huhanpeng
	 */
	public class InitChessBoardDc extends SimpleCommand implements ICommand, INotifier 
	{
		
		override public function execute(note:INotification):void 
		{
			var chessBoardData:IChessBoardData = new ChessBoardData( GlobalConst.setting.CHESSBOARD_SIZE );
			facade.registerProxy( new ChessBoardProxy(chessBoardData) );
			
			var chessBoardMed:ChessBoardMed = new ChessBoardMed();
			facade.registerMediator( chessBoardMed );
			
			( facade.retrieveMediator(GameWindowMed.NAME) as GameWindowMed ).addChild( chessBoardMed.getViewComponent() as DisplayObject );
		}
		
	}

}